<HTML><HEAD><TITLE>current_module(?Module)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">Modules</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>current_module(?Module)</H1>
Succeeds if Module is an existing module.


<DL>
<DT><EM>Module</EM></DT>
<DD>Atom or variable.
</DD>
</DL>
<H2>Description</H2>
   current_module/1 checks if there exists a module of a given name, or
   finds on backtracking the names of all the existing modules.  A module
   exists in the system iff it has been compiled or explicitely created.

<H3>Modes and Determinism</H3><UL>
<LI>current_module(-) is nondet
<LI>current_module(+) is semidet
</UL>
<H3>Fail Conditions</H3>
Fails if Module does not unify with an existing module
<H3>Exceptions</H3>
<DL>
<DT><EM>(5) type error </EM>
<DD>Module is instantiated, but not to an atom.
</DL>
<H2>Examples</H2>
<PRE>
Success:

    [eclipse]: current_module(M).
    M = eclipse     More? (;)
    M = sepia_kernel     More? (;)
    M = eclipse_language     More? (;)
    M = lists     More? (;)
    M = profile     More? (;)
    M = suspend     More? (;)    % type &lt;cr&gt;
    yes.
Fail:
    current_module(not_a_module).
Error:
    current_module("eclipse").         (Error 5).
</PRE>
<H2>See Also</H2>
<A HREF="../../kernel/modules/create_module-1.html">create_module / 1</A>, <A HREF="../../kernel/modules/create_module-3.html">create_module / 3</A>, <A HREF="../../kernel/modules/erase_module-1.html">erase_module / 1</A>, <A HREF="../../kernel/modules/module-1.html">module / 1</A>, <A HREF="../../kernel/modules/get_module_info-3.html">get_module_info / 3</A>
</BODY></HTML>
